home *** CD-ROM | disk | FTP | other *** search
/ Risc World 5 / Risc World 5.iso / SOFTWARE / Issue5 / PD / DIRSYNC / LegalStuff / ccres / c / _Gadgets < prev    next >
Text File  |  2004-03-20  |  39KB  |  677 lines

  1. /* _Gadgets.c
  2.    $Id: _Gadgets.c,v 1.2 2004/03/20 22:13:34 joty Exp $
  3.  
  4.    Copyright (c) 2003-2004 Dave Appleby / John Tytgat
  5.  
  6.    This file is part of CCres.
  7.  
  8.    CCres is free software; you can redistribute it and/or modify
  9.    it under the terms of the GNU General Public License as published by
  10.    the Free Software Foundation; either version 2 of the License, or
  11.    (at your option) any later version.
  12.  
  13.    CCres is distributed in the hope that it will be useful,
  14.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.    GNU General Public License for more details.
  17.  
  18.    You should have received a copy of the GNU General Public License
  19.    along with CCres; if not, write to the Free Software
  20.    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  21.  */
  22.  
  23. #include "ccres.h"
  24.  
  25. #include <stdio.h>
  26.  
  27. #include <OSLib/actionbutton.h>
  28. #include <OSLib/adjuster.h>
  29. #include <OSLib/displayfield.h>
  30. #include <OSLib/draggable.h>
  31. #include <OSLib/label.h>
  32. #include <OSLib/labelledbox.h>
  33. #include <OSLib/numberrange.h>
  34. #include <OSLib/optionbutton.h>
  35. #include <OSLib/popup.h>
  36. #include <OSLib/radiobutton.h>
  37. #include <OSLib/scale.h>
  38. #include <OSLib/scrolllist.h>
  39. #include <OSLib/slider.h>
  40. #include <OSLib/stringset.h>
  41. #include <OSLib/textarea.h>
  42. #include <OSLib/textgadgets.h>
  43. #include <OSLib/toolaction.h>
  44. #include <OSLib/toolbox.h>
  45. #include <OSLib/writablefield.h>
  46.  
  47.  
  48. //
  49.  
  50. static FLAGS ActionButtonFlags[] = {
  51.     {actionbutton_IS_DEFAULT     , "actionbutton_IS_DEFAULT"     },
  52.     {actionbutton_IS_CANCEL      , "actionbutton_IS_CANCEL"      },
  53.     {actionbutton_IS_LOCAL       , "actionbutton_IS_LOCAL"       },
  54.     {actionbutton_IS_MENU        , "actionbutton_IS_MENU"        },
  55.     {actionbutton_SHOW_AS_MENU   , "actionbutton_SHOW_AS_MENU"   },
  56.     {actionbutton_SHOW_AT_CENTRE , "actionbutton_SHOW_AT_CENTRE" },
  57.     {actionbutton_SHOW_AT_POINTER, "actionbutton_SHOW_AT_POINTER"},
  58.     {gadget_FADED                , "gadget_FADED"                },
  59.     {gadget_AT_BACK              , "gadget_AT_BACK"              }
  60. };
  61.  
  62. static OBJECTLIST ActionbuttonObjectList[] = {
  63.     {iol_FLAGS,  "flags:",      offsetof(actionbutton_object, flags),      ActionButtonFlags, ELEMENTS(ActionButtonFlags)              },
  64.     {iol_MSG,    "text:",       offsetof(actionbutton_object, text),       "text_limit:",     offsetof(actionbutton_object, text_limit)},
  65.     {iol_STRING, "click_show:", offsetof(actionbutton_object, click_show), NULL,              0                                        },
  66.     {iol_BITS,   "action:",     offsetof(actionbutton_object, action),     NULL,              bits_ACTION                              }
  67. };
  68.  
  69. int _actionbutton(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  70. {
  71.     put_objects(data, pszIn, nOffset, (PSTR) gadget, ActionbuttonObjectList, ELEMENTS(ActionbuttonObjectList));
  72.  
  73.     return(sizeof(actionbutton_object));
  74. }
  75.  
  76. void actionbutton(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  77. {
  78.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, ActionbuttonObjectList, ELEMENTS(ActionbuttonObjectList), 2);
  79. }
  80.  
  81.  
  82. //
  83.  
  84. static FLAGS AdjusterFlags[] = {
  85.     {adjuster_INCREMENT, "adjuster_INCREMENT"},
  86.     {adjuster_VERTICAL , "adjuster_VERTICAL" },
  87.     {gadget_FADED      , "gadget_FADED"      },
  88.     {gadget_AT_BACK    , "gadget_AT_BACK"    }
  89. };
  90.  
  91. static OBJECTLIST AdjusterObjectList[] = {
  92.     {iol_FLAGS,  "flags:",    offsetof(adjuster_object, flags),    AdjusterFlags, ELEMENTS(AdjusterFlags)},
  93.     {iol_INT,    "reserved:", offsetof(adjuster_object, reserved), NULL,          0                      }
  94. };
  95.  
  96.  
  97. int _adjuster(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  98. {
  99.     put_objects(data, pszIn, nOffset, (PSTR) gadget, AdjusterObjectList, ELEMENTS(AdjusterObjectList));
  100.  
  101.     return(sizeof(adjuster_object));
  102. }
  103.  
  104. void adjuster(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  105. {
  106.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, AdjusterObjectList, ELEMENTS(AdjusterObjectList), 2);
  107. }
  108.  
  109.  
  110. //
  111.  
  112. static FLAGS DisplayFieldFlags[] = {
  113.     {displayfield_RJUSTIFIED     , "displayfield_RJUSTIFIED"     },
  114.     {displayfield_HCENTRED       , "displayfield_HCENTRED"       },
  115.     {gadget_FADED                , "gadget_FADED"                },
  116.     {gadget_AT_BACK              , "gadget_AT_BACK"              }
  117. };
  118.  
  119. static OBJECTLIST DisplayFieldObjectList[] = {
  120.     {iol_FLAGS,  "flags:", offsetof(displayfield_object, flags), DisplayFieldFlags, ELEMENTS(DisplayFieldFlags)},
  121.     {iol_MSG,    "text:",  offsetof(displayfield_object, text),  "text_limit:",     offsetof(displayfield_object, text_limit)}
  122. };
  123.  
  124. int _displayfield(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  125. {
  126.     put_objects(data, pszIn, nOffset, (PSTR) gadget, DisplayFieldObjectList, ELEMENTS(DisplayFieldObjectList));
  127.  
  128.     return(sizeof(displayfield_object));
  129. }
  130.  
  131. void displayfield(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  132. {
  133.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, DisplayFieldObjectList, ELEMENTS(DisplayFieldObjectList), 2);
  134. }
  135.  
  136.  
  137. //
  138.  
  139. static FLAGS DraggableFlags[] = {
  140.     {draggable_GENERATE_DRAG_STARTED                           , "draggable_GENERATE_DRAG_STARTED" },
  141.     {draggable_SPRITE                                          , "draggable_SPRITE"                },
  142.     {draggable_TEXT                                            , "draggable_TEXT"                  },
  143.     {(draggable_TYPE_CLICK_DOUBLE_DRAG << draggable_TYPE_SHIFT), "draggable_TYPE_CLICK_DOUBLE_DRAG"},
  144.     {(draggable_TYPE_CLICK_DRAG        << draggable_TYPE_SHIFT), "draggable_TYPE_CLICK_DRAG"       },
  145.     {draggable_USE_TOOLBOX_IDS                                 , "draggable_USE_TOOLBOX_IDS"       },
  146.     {draggable_DROP_SHADOW                                     , "draggable_DROP_SHADOW"           },
  147.     {draggable_NO_DITHER                                       , "draggable_NO_DITHER"             },
  148.     {gadget_FADED                                              , "gadget_FADED"                    },
  149.     {gadget_AT_BACK                                            , "gadget_AT_BACK"                  }
  150. };
  151.  
  152. static OBJECTLIST DraggableObjectList[] = {
  153.     {iol_FLAGS,  "flags:",       offsetof(draggable_object, flags),       DraggableFlags,  ELEMENTS(DraggableFlags)},
  154.     {iol_MSG,    "text:",        offsetof(draggable_object, text),        "text_limit:",   offsetof(draggable_object, text_limit)},
  155.     {iol_STRING, "sprite_name:", offsetof(draggable_object, sprite_name), "sprite_limit:", offsetof(draggable_object, sprite_limit)},
  156. };
  157.  
  158. int _draggable(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  159. {
  160.     put_objects(data, pszIn, nOffset, (PSTR) gadget, DraggableObjectList, ELEMENTS(DraggableObjectList));
  161.  
  162.     return(sizeof(draggable_object));
  163. }
  164.  
  165. void draggable(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  166. {
  167.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, DraggableObjectList, ELEMENTS(DraggableObjectList), 2);
  168. }
  169.  
  170.  
  171. //
  172.  
  173. static FLAGS LabelFlags[] = {
  174.     {label_NO_BOX    , "label_NO_BOX"    },
  175.     {label_RJUSTIFIED, "label_RJUSTIFIED"},
  176.     {label_HCENTRED  , "label_HCENTRED"  },
  177.     {gadget_FADED    , "gadget_FADED"    },
  178.     {gadget_AT_BACK  , "gadget_AT_BACK"  }
  179. };
  180.  
  181. static OBJECTLIST LabelObjectList[] = {
  182.     {iol_FLAGS, "flags:", offsetof(label_object, flags), LabelFlags, ELEMENTS(LabelFlags)},
  183.     {iol_MSG,   "label:", offsetof(label_object, label), NULL,       0                   }
  184. };
  185.  
  186. int _label(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  187. {
  188.     put_objects(data, pszIn, nOffset, (PSTR) gadget, LabelObjectList, ELEMENTS(LabelObjectList));
  189.  
  190.     return(sizeof(label_object));
  191. }
  192.  
  193. void label(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  194. {
  195.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, LabelObjectList, ELEMENTS(LabelObjectList), 2);
  196. }
  197.  
  198.  
  199. //
  200.  
  201. static FLAGS LabelledBoxFlags[] = {
  202.     {labelledbox_SPRITE          , "labelledbox_SPRITE"          },
  203.     {labelledbox_SPRITE_IS_FILLED, "labelledbox_SPRITE_IS_FILLED"},
  204.     {gadget_FADED                , "gadget_FADED"                },
  205.     {gadget_AT_BACK              , "gadget_AT_BACK"              }
  206. };
  207.  
  208. static OBJECTLIST LabelledBoxObjectList[] = {
  209.     {iol_FLAGS, "flags:", offsetof(labelledbox_object, flags), LabelledBoxFlags, ELEMENTS(LabelledBoxFlags)},
  210.     {iol_MSG,   "label:", offsetof(labelledbox_object, label), NULL,             0                         }
  211. };
  212.  
  213. int _labelledbox(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  214. {
  215.     put_objects(data, pszIn, nOffset, (PSTR) gadget, LabelledBoxObjectList, ELEMENTS(LabelledBoxObjectList));
  216.  
  217.     return(sizeof(labelledbox_object));
  218. }
  219.  
  220. void labelledbox(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  221. {
  222.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, LabelledBoxObjectList, ELEMENTS(LabelledBoxObjectList), 2);
  223. }
  224.  
  225.  
  226. //
  227.  
  228. #define numberrange_ABS_SLIDER_TYPE_RIGHT (numberrange_SLIDER_TYPE_RIGHT << numberrange_SLIDER_TYPE_SHIFT)
  229. #define numberrange_ABS_SLIDER_TYPE_LEFT  (numberrange_SLIDER_TYPE_LEFT << numberrange_SLIDER_TYPE_SHIFT)
  230. #define numberrange_KNOB_COLOUR_VERY_LIGHT_GREY    (wimp_COLOUR_VERY_LIGHT_GREY << numberrange_KNOB_COLOUR_SHIFT)
  231. #define numberrange_KNOB_COLOUR_LIGHT_GREY         (wimp_COLOUR_LIGHT_GREY      << numberrange_KNOB_COLOUR_SHIFT)
  232. #define numberrange_KNOB_COLOUR_MID_LIGHT_GREY     (wimp_COLOUR_MID_LIGHT_GREY  << numberrange_KNOB_COLOUR_SHIFT)
  233. #define numberrange_KNOB_COLOUR_MID_DARK_GREY      (wimp_COLOUR_MID_DARK_GREY   << numberrange_KNOB_COLOUR_SHIFT)
  234. #define numberrange_KNOB_COLOUR_DARK_GREY          (wimp_COLOUR_DARK_GREY       << numberrange_KNOB_COLOUR_SHIFT)
  235. #define numberrange_KNOB_COLOUR_VERY_DARK_GREY     (wimp_COLOUR_VERY_DARK_GREY  << numberrange_KNOB_COLOUR_SHIFT)
  236. #define numberrange_KNOB_COLOUR_BLACK              (wimp_COLOUR_BLACK           << numberrange_KNOB_COLOUR_SHIFT)
  237. #define numberrange_KNOB_COLOUR_DARK_BLUE          (wimp_COLOUR_DARK_BLUE       << numberrange_KNOB_COLOUR_SHIFT)
  238. #define numberrange_KNOB_COLOUR_YELLOW             (wimp_COLOUR_YELLOW          << numberrange_KNOB_COLOUR_SHIFT)
  239. #define numberrange_KNOB_COLOUR_LIGHT_GREEN        (wimp_COLOUR_LIGHT_GREEN     << numberrange_KNOB_COLOUR_SHIFT)
  240. #define numberrange_KNOB_COLOUR_RED                (wimp_COLOUR_RED             << numberrange_KNOB_COLOUR_SHIFT)
  241. #define numberrange_KNOB_COLOUR_CREAM              (wimp_COLOUR_CREAM           << numberrange_KNOB_COLOUR_SHIFT)
  242. #define numberrange_KNOB_COLOUR_DARK_GREEN         (wimp_COLOUR_DARK_GREEN      << numberrange_KNOB_COLOUR_SHIFT)
  243. #define numberrange_KNOB_COLOUR_ORANGE             (wimp_COLOUR_ORANGE          << numberrange_KNOB_COLOUR_SHIFT)
  244. #define numberrange_KNOB_COLOUR_LIGHT_BLUE         (wimp_COLOUR_LIGHT_BLUE      << numberrange_KNOB_COLOUR_SHIFT)
  245. #define numberrange_WELL_COLOUR_VERY_LIGHT_GREY    (wimp_COLOUR_VERY_LIGHT_GREY << numberrange_WELL_COLOUR_SHIFT)
  246. #define numberrange_WELL_COLOUR_LIGHT_GREY         (wimp_COLOUR_LIGHT_GREY      << numberrange_WELL_COLOUR_SHIFT)
  247. #define numberrange_WELL_COLOUR_MID_LIGHT_GREY     (wimp_COLOUR_MID_LIGHT_GREY  << numberrange_WELL_COLOUR_SHIFT)
  248. #define numberrange_WELL_COLOUR_MID_DARK_GREY      (wimp_COLOUR_MID_DARK_GREY   << numberrange_WELL_COLOUR_SHIFT)
  249. #define numberrange_WELL_COLOUR_DARK_GREY          (wimp_COLOUR_DARK_GREY       << numberrange_WELL_COLOUR_SHIFT)
  250. #define numberrange_WELL_COLOUR_VERY_DARK_GREY     (wimp_COLOUR_VERY_DARK_GREY  << numberrange_WELL_COLOUR_SHIFT)
  251. #define numberrange_WELL_COLOUR_BLACK              (wimp_COLOUR_BLACK           << numberrange_WELL_COLOUR_SHIFT)
  252. #define numberrange_WELL_COLOUR_DARK_BLUE          (wimp_COLOUR_DARK_BLUE       << numberrange_WELL_COLOUR_SHIFT)
  253. #define numberrange_WELL_COLOUR_YELLOW             (wimp_COLOUR_YELLOW          << numberrange_WELL_COLOUR_SHIFT)
  254. #define numberrange_WELL_COLOUR_LIGHT_GREEN        (wimp_COLOUR_LIGHT_GREEN     << numberrange_WELL_COLOUR_SHIFT)
  255. #define numberrange_WELL_COLOUR_RED                (wimp_COLOUR_RED             << numberrange_WELL_COLOUR_SHIFT)
  256. #define numberrange_WELL_COLOUR_CREAM              (wimp_COLOUR_CREAM           << numberrange_WELL_COLOUR_SHIFT)
  257. #define numberrange_WELL_COLOUR_DARK_GREEN         (wimp_COLOUR_DARK_GREEN      << numberrange_WELL_COLOUR_SHIFT)
  258. #define numberrange_WELL_COLOUR_ORANGE             (wimp_COLOUR_ORANGE          << numberrange_WELL_COLOUR_SHIFT)
  259. #define numberrange_WELL_COLOUR_LIGHT_BLUE         (wimp_COLOUR_LIGHT_BLUE      << numberrange_WELL_COLOUR_SHIFT)
  260.  
  261. static FLAGS NumberRangeFlags[] = {
  262.     {numberrange_GENERATE_VALUE_CHANGED     , "numberrange_GENERATE_VALUE_CHANGED"     },
  263.     {numberrange_WRITABLE                   , "numberrange_WRITABLE"                   },
  264.     {numberrange_HAS_NUMERICAL_DISPLAY      , "numberrange_HAS_NUMERICAL_DISPLAY"      },
  265.     {numberrange_ADJUSTERS                  , "numberrange_ADJUSTERS"                  },
  266.     {numberrange_ABS_SLIDER_TYPE_RIGHT      , "numberrange_SLIDER_TYPE_RIGHT"          },
  267.     {numberrange_ABS_SLIDER_TYPE_LEFT       , "numberrange_SLIDER_TYPE_LEFT"           },
  268.     {numberrange_RJUSTIFIED                 , "numberrange_RJUSTIFIED"                 },
  269.     {numberrange_HCENTRED                   , "numberrange_HCENTRED"                   },
  270.     {numberrange_KNOB_COLOUR_VERY_LIGHT_GREY, "numberrange_KNOB_COLOUR_VERY_LIGHT_GREY"},
  271.     {numberrange_KNOB_COLOUR_LIGHT_GREY     , "numberrange_KNOB_COLOUR_LIGHT_GREY"     },
  272.     {numberrange_KNOB_COLOUR_MID_LIGHT_GREY , "numberrange_KNOB_COLOUR_MID_LIGHT_GREY" },
  273.     {numberrange_KNOB_COLOUR_MID_DARK_GREY  , "numberrange_KNOB_COLOUR_MID_DARK_GREY"  },
  274.     {numberrange_KNOB_COLOUR_DARK_GREY      , "numberrange_KNOB_COLOUR_DARK_GREY"      },
  275.     {numberrange_KNOB_COLOUR_VERY_DARK_GREY , "numberrange_KNOB_COLOUR_VERY_DARK_GREY" },
  276.     {numberrange_KNOB_COLOUR_BLACK          , "numberrange_KNOB_COLOUR_BLACK"          },
  277.     {numberrange_KNOB_COLOUR_DARK_BLUE      , "numberrange_KNOB_COLOUR_DARK_BLUE"      },
  278.     {numberrange_KNOB_COLOUR_YELLOW         , "numberrange_KNOB_COLOUR_YELLOW"         },
  279.     {numberrange_KNOB_COLOUR_LIGHT_GREEN    , "numberrange_KNOB_COLOUR_LIGHT_GREEN"    },
  280.     {numberrange_KNOB_COLOUR_RED            , "numberrange_KNOB_COLOUR_RED"            },
  281.     {numberrange_KNOB_COLOUR_CREAM          , "numberrange_KNOB_COLOUR_CREAM"          },
  282.     {numberrange_KNOB_COLOUR_DARK_GREEN     , "numberrange_KNOB_COLOUR_DARK_GREEN"     },
  283.     {numberrange_KNOB_COLOUR_ORANGE         , "numberrange_KNOB_COLOUR_ORANGE"         },
  284.     {numberrange_KNOB_COLOUR_LIGHT_BLUE     , "numberrange_KNOB_COLOUR_LIGHT_BLUE"     },
  285.     {numberrange_WELL_COLOUR_VERY_LIGHT_GREY, "numberrange_WELL_COLOUR_VERY_LIGHT_GREY"},
  286.     {numberrange_WELL_COLOUR_LIGHT_GREY     , "numberrange_WELL_COLOUR_LIGHT_GREY"     },
  287.     {numberrange_WELL_COLOUR_MID_LIGHT_GREY , "numberrange_WELL_COLOUR_MID_LIGHT_GREY" },
  288.     {numberrange_WELL_COLOUR_MID_DARK_GREY  , "numberrange_WELL_COLOUR_MID_DARK_GREY"  },
  289.     {numberrange_WELL_COLOUR_DARK_GREY      , "numberrange_WELL_COLOUR_DARK_GREY"      },
  290.     {numberrange_WELL_COLOUR_VERY_DARK_GREY , "numberrange_WELL_COLOUR_VERY_DARK_GREY" },
  291.     {numberrange_WELL_COLOUR_BLACK          , "numberrange_WELL_COLOUR_BLACK"          },
  292.     {numberrange_WELL_COLOUR_DARK_BLUE      , "numberrange_WELL_COLOUR_DARK_BLUE"      },
  293.     {numberrange_WELL_COLOUR_YELLOW         , "numberrange_WELL_COLOUR_YELLOW"         },
  294.     {numberrange_WELL_COLOUR_LIGHT_GREEN    , "numberrange_WELL_COLOUR_LIGHT_GREEN"    },
  295.     {numberrange_WELL_COLOUR_RED            , "numberrange_WELL_COLOUR_RED"            },
  296.     {numberrange_WELL_COLOUR_CREAM          , "numberrange_WELL_COLOUR_CREAM"          },
  297.     {numberrange_WELL_COLOUR_DARK_GREEN     , "numberrange_WELL_COLOUR_DARK_GREEN"     },
  298.     {numberrange_WELL_COLOUR_ORANGE         , "numberrange_WELL_COLOUR_ORANGE"         },
  299.     {numberrange_WELL_COLOUR_LIGHT_BLUE     , "numberrange_WELL_COLOUR_LIGHT_BLUE"     },
  300.     {gadget_FADED                           , "gadget_FADED"                           },
  301.     {gadget_AT_BACK                         , "gadget_AT_BACK"                         }
  302. };
  303.  
  304. static OBJECTLIST NumberRangeObjectList[] = {
  305.     {iol_FLAGS,  "flags:",          offsetof(numberrange_object, flags),          NumberRangeFlags, ELEMENTS(NumberRangeFlags)},
  306.     {iol_INT,    "lower_bound:",    offsetof(numberrange_object, lower_bound),    NULL,             0                         },
  307.     {iol_INT,    "upper_bound:",    offsetof(numberrange_object, upper_bound),    NULL,             0                         },
  308.     {iol_INT,    "step_size:",      offsetof(numberrange_object, step_size),      NULL,             0                         },
  309.     {iol_INT,    "initial_value:",  offsetof(numberrange_object, initial_value),  NULL,             0                         },
  310.     {iol_INT,    "precision:",      offsetof(numberrange_object, precision),      NULL,             0                         },
  311.     {iol_CMP,    "prev:",           offsetof(numberrange_object, prev),           NULL,             0                         },
  312.     {iol_CMP,    "next:",           offsetof(numberrange_object, next),           NULL,             0                         },
  313.     {iol_INT,    "display_length:", offsetof(numberrange_object, display_length), NULL,             0                         }
  314. };
  315.  
  316. int _numberrange(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  317. {
  318.     put_objects(data, pszIn, nOffset, (PSTR) gadget, NumberRangeObjectList, ELEMENTS(NumberRangeObjectList));
  319.  
  320.     return(sizeof(numberrange_object));
  321. }
  322.  
  323. void numberrange(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  324. {
  325.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, NumberRangeObjectList, ELEMENTS(NumberRangeObjectList), 2);
  326. }
  327.  
  328.  
  329. static FLAGS OptionButtonFlags[] = {
  330.     {optionbutton_GENERATE_STATE_CHANGED, "optionbutton_GENERATE_STATE_CHANGED"},
  331.     {optionbutton_ON                    , "optionbutton_ON"                    },
  332.     {gadget_FADED                       , "gadget_FADED"                       },
  333.     {gadget_AT_BACK                     , "gadget_AT_BACK"                     }
  334. };
  335.  
  336. static OBJECTLIST OptionButtonObjectList[] = {
  337.     {iol_FLAGS,  "flags:",  offsetof(optionbutton_object, flags),  OptionButtonFlags,  ELEMENTS(OptionButtonFlags)               },
  338.     {iol_MSG,    "label:",  offsetof(optionbutton_object, label),  "label_limit:",     offsetof(optionbutton_object, label_limit)},
  339.     {iol_BITS,   "action:", offsetof(optionbutton_object, action), NULL,               bits_ACTION                                }
  340. };
  341.  
  342. int _optionbutton(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  343. {
  344.     put_objects(data, pszIn, nOffset, (PSTR) gadget, OptionButtonObjectList, ELEMENTS(OptionButtonObjectList));
  345.  
  346.     return(sizeof(optionbutton_object));
  347. }
  348.  
  349. void optionbutton(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  350. {
  351.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, OptionButtonObjectList, ELEMENTS(OptionButtonObjectList), 2);
  352. }
  353.  
  354.  
  355. //
  356.  
  357. static FLAGS PopupFlags[] = {
  358.     {popup_GENERATE_ABOUT_TO_BE_SHOWN, "popup_GENERATE_ABOUT_TO_BE_SHOWN"},
  359.     {gadget_FADED                    , "gadget_FADED"                    },
  360.     {gadget_AT_BACK                  , "gadget_AT_BACK"                  }
  361. };
  362.  
  363. static OBJECTLIST PopupObjectList[] = {
  364.     {iol_FLAGS,  "flags:",     offsetof(popup_object, flags),      PopupFlags, ELEMENTS(PopupFlags)},
  365.     {iol_STRING, "menu_name:", offsetof(popup_object, menu_name),  NULL,       0                   }
  366. };
  367.  
  368. int _popup(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  369. {
  370.     put_objects(data, pszIn, nOffset, (PSTR) gadget, PopupObjectList, ELEMENTS(PopupObjectList));
  371.  
  372.     return(sizeof(popup_object));
  373. }
  374.  
  375. void popup(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  376. {
  377.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, PopupObjectList, ELEMENTS(PopupObjectList), 2);
  378. }
  379.  
  380.  
  381. //
  382.  
  383. static FLAGS RadioButtonFlags[] = {
  384.     {radiobutton_GENERATE_STATE_CHANGED    , "radiobutton_GENERATE_STATE_CHANGED"    },
  385.     {radiobutton_GENERATE_SET_STATE_CHANGED, "radiobutton_GENERATE_SET_STATE_CHANGED"},
  386.     {radiobutton_ON                        , "radiobutton_ON"                        },
  387.     {gadget_FADED                          , "gadget_FADED"                          },
  388.     {gadget_AT_BACK                        , "gadget_AT_BACK"                        }
  389. };
  390.  
  391. static OBJECTLIST RadioButtonObjectList[] = {
  392.     {iol_FLAGS, "flags:",  offsetof(radiobutton_object, flags),  RadioButtonFlags, ELEMENTS(RadioButtonFlags)               },
  393.     {iol_INT,   "group:",  offsetof(radiobutton_object, group),  NULL,             0                                        },
  394.     {iol_MSG,   "label:",  offsetof(radiobutton_object, label),  "label_limit:",   offsetof(radiobutton_object, label_limit)},
  395.     {iol_BITS,  "action:", offsetof(radiobutton_object, action), NULL,             bits_ACTION                               }
  396. };
  397.  
  398. int _radiobutton(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  399. {
  400.     put_objects(data, pszIn, nOffset, (PSTR) gadget, RadioButtonObjectList, ELEMENTS(RadioButtonObjectList));
  401.  
  402.     return(sizeof(radiobutton_object));
  403. }
  404.  
  405. void radiobutton(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  406. {
  407.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, RadioButtonObjectList, ELEMENTS(RadioButtonObjectList), 2);
  408. }
  409.  
  410.  
  411. //
  412.  
  413. static FLAGS ScrolllistFlags[] = {
  414.     {scrolllist_STATE_ALLOW_MULTIPLE_SELECTIONS, "scrolllist_STATE_ALLOW_MULTIPLE_SELECTIONS"},
  415.     {gadget_FADED                              , "gadget_FADED"                              },
  416.     {gadget_AT_BACK                            , "gadget_AT_BACK"                            }
  417. };
  418.  
  419. static OBJECTLIST ScrolllistObjectList[] = {
  420.     {iol_FLAGS, "flags:",      offsetof(scrolllist_object, flags),      ScrolllistFlags, ELEMENTS(ScrolllistFlags)},
  421.     {iol_INT,   "event:",      offsetof(scrolllist_object, event),      NULL,            0                        },
  422.     {iol_OSCOL, "foreground:", offsetof(scrolllist_object, foreground), NULL,            0                        },
  423.     {iol_OSCOL, "background:", offsetof(scrolllist_object, background), NULL,            0                        }
  424. };
  425.  
  426. int _scrolllist(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  427. {
  428.     put_objects(data, pszIn, nOffset, (PSTR) gadget, ScrolllistObjectList, ELEMENTS(ScrolllistObjectList));
  429.  
  430.     return(sizeof(scrolllist_object));
  431. }
  432.  
  433. void scrolllist(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  434. {
  435.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, ScrolllistObjectList, ELEMENTS(ScrolllistObjectList), 2);
  436. }
  437.  
  438. #define slider_KNOB_COLOUR_VERY_LIGHT_GREY    (wimp_COLOUR_VERY_LIGHT_GREY << slider_KNOB_COLOUR_SHIFT)
  439. #define slider_KNOB_COLOUR_LIGHT_GREY         (wimp_COLOUR_LIGHT_GREY      << slider_KNOB_COLOUR_SHIFT)
  440. #define slider_KNOB_COLOUR_MID_LIGHT_GREY     (wimp_COLOUR_MID_LIGHT_GREY  << slider_KNOB_COLOUR_SHIFT)
  441. #define slider_KNOB_COLOUR_MID_DARK_GREY      (wimp_COLOUR_MID_DARK_GREY   << slider_KNOB_COLOUR_SHIFT)
  442. #define slider_KNOB_COLOUR_DARK_GREY          (wimp_COLOUR_DARK_GREY       << slider_KNOB_COLOUR_SHIFT)
  443. #define slider_KNOB_COLOUR_VERY_DARK_GREY     (wimp_COLOUR_VERY_DARK_GREY  << slider_KNOB_COLOUR_SHIFT)
  444. #define slider_KNOB_COLOUR_BLACK              (wimp_COLOUR_BLACK           << slider_KNOB_COLOUR_SHIFT)
  445. #define slider_KNOB_COLOUR_DARK_BLUE          (wimp_COLOUR_DARK_BLUE       << slider_KNOB_COLOUR_SHIFT)
  446. #define slider_KNOB_COLOUR_YELLOW             (wimp_COLOUR_YELLOW          << slider_KNOB_COLOUR_SHIFT)
  447. #define slider_KNOB_COLOUR_LIGHT_GREEN        (wimp_COLOUR_LIGHT_GREEN     << slider_KNOB_COLOUR_SHIFT)
  448. #define slider_KNOB_COLOUR_RED                (wimp_COLOUR_RED             << slider_KNOB_COLOUR_SHIFT)
  449. #define slider_KNOB_COLOUR_CREAM              (wimp_COLOUR_CREAM           << slider_KNOB_COLOUR_SHIFT)
  450. #define slider_KNOB_COLOUR_DARK_GREEN         (wimp_COLOUR_DARK_GREEN      << slider_KNOB_COLOUR_SHIFT)
  451. #define slider_KNOB_COLOUR_ORANGE             (wimp_COLOUR_ORANGE          << slider_KNOB_COLOUR_SHIFT)
  452. #define slider_KNOB_COLOUR_LIGHT_BLUE         (wimp_COLOUR_LIGHT_BLUE      << slider_KNOB_COLOUR_SHIFT)
  453. #define slider_WELL_COLOUR_VERY_LIGHT_GREY    (wimp_COLOUR_VERY_LIGHT_GREY << slider_WELL_COLOUR_SHIFT)
  454. #define slider_WELL_COLOUR_LIGHT_GREY         (wimp_COLOUR_LIGHT_GREY      << slider_WELL_COLOUR_SHIFT)
  455. #define slider_WELL_COLOUR_MID_LIGHT_GREY     (wimp_COLOUR_MID_LIGHT_GREY  << slider_WELL_COLOUR_SHIFT)
  456. #define slider_WELL_COLOUR_MID_DARK_GREY      (wimp_COLOUR_MID_DARK_GREY   << slider_WELL_COLOUR_SHIFT)
  457. #define slider_WELL_COLOUR_DARK_GREY          (wimp_COLOUR_DARK_GREY       << slider_WELL_COLOUR_SHIFT)
  458. #define slider_WELL_COLOUR_VERY_DARK_GREY     (wimp_COLOUR_VERY_DARK_GREY  << slider_WELL_COLOUR_SHIFT)
  459. #define slider_WELL_COLOUR_BLACK              (wimp_COLOUR_BLACK           << slider_WELL_COLOUR_SHIFT)
  460. #define slider_WELL_COLOUR_DARK_BLUE          (wimp_COLOUR_DARK_BLUE       << slider_WELL_COLOUR_SHIFT)
  461. #define slider_WELL_COLOUR_YELLOW             (wimp_COLOUR_YELLOW          << slider_WELL_COLOUR_SHIFT)
  462. #define slider_WELL_COLOUR_LIGHT_GREEN        (wimp_COLOUR_LIGHT_GREEN     << slider_WELL_COLOUR_SHIFT)
  463. #define slider_WELL_COLOUR_RED                (wimp_COLOUR_RED             << slider_WELL_COLOUR_SHIFT)
  464. #define slider_WELL_COLOUR_CREAM              (wimp_COLOUR_CREAM           << slider_WELL_COLOUR_SHIFT)
  465. #define slider_WELL_COLOUR_DARK_GREEN         (wimp_COLOUR_DARK_GREEN      << slider_WELL_COLOUR_SHIFT)
  466. #define slider_WELL_COLOUR_ORANGE             (wimp_COLOUR_ORANGE          << slider_WELL_COLOUR_SHIFT)
  467. #define slider_WELL_COLOUR_LIGHT_BLUE         (wimp_COLOUR_LIGHT_BLUE      << slider_WELL_COLOUR_SHIFT)
  468.  
  469. static FLAGS SliderFlags[] = {
  470.     {slider_GENERATE_VALUE_CHANGED            , "slider_GENERATE_VALUE_CHANGED"            },
  471.     {slider_GENERATE_VALUE_CHANGED_BY_DRAGGING, "slider_GENERATE_VALUE_CHANGED_BY_DRAGGING"},
  472.     {slider_GENERATE_SET_VALUE_CHANGED        , "slider_GENERATE_SET_VALUE_CHANGED"        },
  473.     {slider_VERTICAL                          , "slider_VERTICAL"                          },
  474.     {slider_DRAGGABLE                         , "slider_DRAGGABLE"                         },
  475.     {slider_KNOB_COLOUR_VERY_LIGHT_GREY       , "slider_KNOB_COLOUR_VERY_LIGHT_GREY"       },
  476.     {slider_KNOB_COLOUR_LIGHT_GREY            , "slider_KNOB_COLOUR_LIGHT_GREY"            },
  477.     {slider_KNOB_COLOUR_MID_LIGHT_GREY        , "slider_KNOB_COLOUR_MID_LIGHT_GREY"        },
  478.     {slider_KNOB_COLOUR_MID_DARK_GREY         , "slider_KNOB_COLOUR_MID_DARK_GREY"         },
  479.     {slider_KNOB_COLOUR_DARK_GREY             , "slider_KNOB_COLOUR_DARK_GREY"             },
  480.     {slider_KNOB_COLOUR_VERY_DARK_GREY        , "slider_KNOB_COLOUR_VERY_DARK_GREY"        },
  481.     {slider_KNOB_COLOUR_BLACK                 , "slider_KNOB_COLOUR_BLACK"                 },
  482.     {slider_KNOB_COLOUR_DARK_BLUE             , "slider_KNOB_COLOUR_DARK_BLUE"             },
  483.     {slider_KNOB_COLOUR_YELLOW                , "slider_KNOB_COLOUR_YELLOW"                },
  484.     {slider_KNOB_COLOUR_LIGHT_GREEN           , "slider_KNOB_COLOUR_LIGHT_GREEN"           },
  485.     {slider_KNOB_COLOUR_RED                   , "slider_KNOB_COLOUR_RED"                   },
  486.     {slider_KNOB_COLOUR_CREAM                 , "slider_KNOB_COLOUR_CREAM"                 },
  487.     {slider_KNOB_COLOUR_DARK_GREEN            , "slider_KNOB_COLOUR_DARK_GREEN"            },
  488.     {slider_KNOB_COLOUR_ORANGE                , "slider_KNOB_COLOUR_ORANGE"                },
  489.     {slider_KNOB_COLOUR_LIGHT_BLUE            , "slider_KNOB_COLOUR_LIGHT_BLUE"            },
  490.     {slider_WELL_COLOUR_VERY_LIGHT_GREY       , "slider_WELL_COLOUR_VERY_LIGHT_GREY"       },
  491.     {slider_WELL_COLOUR_LIGHT_GREY            , "slider_WELL_COLOUR_LIGHT_GREY"            },
  492.     {slider_WELL_COLOUR_MID_LIGHT_GREY        , "slider_WELL_COLOUR_MID_LIGHT_GREY"        },
  493.     {slider_WELL_COLOUR_MID_DARK_GREY         , "slider_WELL_COLOUR_MID_DARK_GREY"         },
  494.     {slider_WELL_COLOUR_DARK_GREY             , "slider_WELL_COLOUR_DARK_GREY"             },
  495.     {slider_WELL_COLOUR_VERY_DARK_GREY        , "slider_WELL_COLOUR_VERY_DARK_GREY"        },
  496.     {slider_WELL_COLOUR_BLACK                 , "slider_WELL_COLOUR_BLACK"                 },
  497.     {slider_WELL_COLOUR_DARK_BLUE             , "slider_WELL_COLOUR_DARK_BLUE"             },
  498.     {slider_WELL_COLOUR_YELLOW                , "slider_WELL_COLOUR_YELLOW"                },
  499.     {slider_WELL_COLOUR_LIGHT_GREEN           , "slider_WELL_COLOUR_LIGHT_GREEN"           },
  500.     {slider_WELL_COLOUR_RED                   , "slider_WELL_COLOUR_RED"                   },
  501.     {slider_WELL_COLOUR_CREAM                 , "slider_WELL_COLOUR_CREAM"                 },
  502.     {slider_WELL_COLOUR_DARK_GREEN            , "slider_WELL_COLOUR_DARK_GREEN"            },
  503.     {slider_WELL_COLOUR_ORANGE                , "slider_WELL_COLOUR_ORANGE"                },
  504.     {slider_WELL_COLOUR_LIGHT_BLUE            , "slider_WELL_COLOUR_LIGHT_BLUE"            },
  505.     {gadget_FADED                             , "gadget_FADED"                             },
  506.     {gadget_AT_BACK                           , "gadget_AT_BACK"                           }
  507. };
  508.  
  509. static OBJECTLIST SliderObjectList[] = {
  510.     {iol_FLAGS, "flags:",         offsetof(slider_object, flags),         SliderFlags, ELEMENTS(SliderFlags)},
  511.     {iol_INT,   "lower_bound:",   offsetof(slider_object, lower_bound),   NULL,        0                    },
  512.     {iol_INT,   "upper_bound:",   offsetof(slider_object, upper_bound),   NULL,        0                    },
  513.     {iol_INT,   "step_size:",     offsetof(slider_object, step_size),     NULL,        0                    },
  514.     {iol_INT,   "initial_value:", offsetof(slider_object, initial_value), NULL,        0                    }
  515. };
  516.  
  517. int _slider(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  518. {
  519.     put_objects(data, pszIn, nOffset, (PSTR) gadget, SliderObjectList, ELEMENTS(SliderObjectList));
  520.  
  521.     return(sizeof(slider_object));
  522. }
  523.  
  524. void slider(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  525. {
  526.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, SliderObjectList, ELEMENTS(SliderObjectList), 2);
  527. }
  528.  
  529.  
  530. //
  531.  
  532. #define stringset_ABS_JUSTIFICATION_RIGHT   (stringset_JUSTIFICATION_RIGHT   << stringset_JUSTIFICATION_SHIFT)
  533. #define stringset_ABS_JUSTIFICATION_CENTRED (stringset_JUSTIFICATION_CENTRED << stringset_JUSTIFICATION_SHIFT)
  534.  
  535. static FLAGS StringsetFlags[] = {
  536.     {stringset_GENERATE_USER_VALUE_CHANGED, "stringset_GENERATE_USER_VALUE_CHANGED"},
  537.     {stringset_GENERATE_SET_VALUE_CHANGED , "stringset_GENERATE_SET_VALUE_CHANGED" },
  538.     {stringset_WRITABLE                   , "stringset_WRITABLE"                   },
  539.     {stringset_GENERATE_ABOUT_TO_BE_SHOWN , "stringset_GENERATE_ABOUT_TO_BE_SHOWN" },
  540.     {stringset_NO_DISPLAY                 , "stringset_NO_DISPLAY"                 },
  541.     {stringset_ABS_JUSTIFICATION_RIGHT    , "stringset_JUSTIFICATION_RIGHT"        },
  542.     {stringset_ABS_JUSTIFICATION_CENTRED  , "stringset_JUSTIFICATION_CENTRED"      },
  543.     {gadget_FADED                         , "gadget_FADED"                         },
  544.     {gadget_AT_BACK                       , "gadget_AT_BACK"                       }
  545. };
  546.  
  547. static OBJECTLIST StringsetObjectList[] = {
  548.     {iol_FLAGS, "flags:",                   offsetof(stringset_object, flags),                   StringsetFlags,           ELEMENTS(StringsetFlags)                         },
  549.     {iol_MSG,   "string_set:",              offsetof(stringset_object, string_set),              NULL,                     0                                                },
  550.     {iol_MSG,   "title:",                   offsetof(stringset_object, title),                   NULL,                     0                                                },
  551.     {iol_MSG,   "initial_selected_string:", offsetof(stringset_object, initial_selected_string), "selected_string_limit:", offsetof(stringset_object, selected_string_limit)},
  552.     {iol_MSG,   "allowable:",               offsetof(stringset_object, allowable),               "allowable_limit:",       offsetof(stringset_object, allowable_limit)      },
  553.     {iol_CMP,   "prev:",                    offsetof(stringset_object, prev),                    NULL,                     0                                                },
  554.     {iol_CMP,   "next:",                    offsetof(stringset_object, next),                    NULL,                     0                                                }
  555. };
  556.  
  557. int _stringset(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  558. {
  559.     put_objects(data, pszIn, nOffset, (PSTR) gadget, StringsetObjectList, ELEMENTS(StringsetObjectList));
  560.  
  561.     return(sizeof(stringset_object));
  562. }
  563.  
  564. void stringset(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  565. {
  566.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, StringsetObjectList, ELEMENTS(StringsetObjectList), 2);
  567. }
  568.  
  569. //
  570.  
  571. static FLAGS TextAreaFlags[] = {
  572.     {textarea_STATE_HAS_VERTICAL_SCROLLBAR  , "textarea_STATE_HAS_VERTICAL_SCROLLBAR"  },
  573.     {textarea_STATE_HAS_HORIZONTAL_SCROLLBAR, "textarea_STATE_HAS_HORIZONTAL_SCROLLBAR"},
  574.     {textarea_STATE_WORDWRAPPING_ENABLED    , "textarea_STATE_WORDWRAPPING_ENABLED"    },
  575.     {textarea_ALLOW_SELECTION               , "textarea_ALLOW_SELECTION"               },
  576.     {textarea_ALLOW_SAVE                    , "textarea_ALLOW_SAVE"                    },
  577.     {textarea_ALLOW_LOAD                    , "textarea_ALLOW_LOAD"                    },
  578.     {textarea_CLIPBOARD                     , "textarea_CLIPBOARD"                     },
  579.     {textarea_AUTO_SCROLL                   , "textarea_AUTO_SCROLL"                   },
  580.     {gadget_FADED                           , "gadget_FADED"                           },
  581.     {gadget_AT_BACK                         , "gadget_AT_BACK"                         }
  582. };
  583.  
  584. static OBJECTLIST TextAreaObjectList[] = {
  585.     {iol_FLAGS,  "flags:",      offsetof(textarea_object, flags),      TextAreaFlags, ELEMENTS(TextAreaFlags)},
  586.     {iol_INT,    "type:",       offsetof(textarea_object, type),       NULL,          0                      },
  587.     {iol_INT,    "event:",      offsetof(textarea_object, event),      NULL,          0                      },
  588.     {iol_MSG,    "text:",       offsetof(textarea_object, text),       NULL,          0                      },
  589.     {iol_OSCOL,  "foreground:", offsetof(textarea_object, foreground), NULL,          0                      },
  590.     {iol_OSCOL,  "background:", offsetof(textarea_object, background), NULL,          0                      }
  591. };
  592.  
  593. int _textarea(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  594. {
  595.     put_objects(data, pszIn, nOffset, (PSTR) gadget, TextAreaObjectList, ELEMENTS(TextAreaObjectList));
  596.  
  597.     return(sizeof(textarea_object));
  598. }
  599.  
  600. void textarea(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  601. {
  602.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, TextAreaObjectList, ELEMENTS(TextAreaObjectList), 2);
  603. }
  604.  
  605.  
  606. //
  607.  
  608. static FLAGS ToolActionFlags[] = {
  609.     {toolaction_GENERATE_SELECT  , "toolaction_GENERATE_SELECT"  },
  610.     {toolaction_IS_TEXT          , "toolaction_IS_TEXT"          },
  611.     {toolaction_ON               , "toolaction_ON"               },
  612.     {toolaction_AUTO_TOGGLE      , "toolaction_AUTO_TOGGLE"      },
  613.     {toolaction_NO_PRESSED_SPRITE, "toolaction_NO_PRESSED_SPRITE"},
  614.     {toolaction_AUTO_REPEAT      , "toolaction_AUTO_REPEAT"      },
  615.     {toolaction_SHOW_TRANSIENT   , "toolaction_SHOW_TRANSIENT"   },
  616.     {toolaction_SHOW_AS_POP_UP   , "toolaction_SHOW_AS_POP_UP"   },
  617.     {toolaction_HAS_FADE_SPRITE  , "toolaction_HAS_FADE_SPRITE"  },
  618.     {gadget_FADED                , "gadget_FADED"                },
  619.     {gadget_AT_BACK              , "gadget_AT_BACK"              }
  620. };
  621.  
  622. static OBJECTLIST ToolActionObjectList[] = {
  623.     {iol_FLAGS,  "flags:",         offsetof(toolaction_object, flags),          ToolActionFlags,    ELEMENTS(ToolActionFlags)                   },
  624.     {iol_STRING, "off_text:",      offsetof(toolaction_object, off_text),       "off_text_limit:",  offsetof(toolaction_object, off_text_limit) },
  625.     {iol_STRING, "on_text:",       offsetof(toolaction_object, on_text),        "on_text_limit:",   offsetof(toolaction_object, on_text_limit)  },
  626.     {iol_BITS,   "click_action:",  offsetof(toolaction_object, click_action),   NULL,               bits_ACTION                                 },
  627.     {iol_STRING, "select_show:",   offsetof(toolaction_object, select_show),    NULL,               0                                           },
  628.     {iol_BITS,   "adjust_action:", offsetof(toolaction_object, adjust_action),  NULL,               bits_ACTION                                 },
  629.     {iol_STRING, "adjust_show:",   offsetof(toolaction_object, adjust_show),    NULL,               0                                           },
  630.     {iol_STRING, "fade_text:",     offsetof(toolaction_object, fade_text),      "fade_text_limit:", offsetof(toolaction_object, fade_text_limit)}
  631. };
  632.  
  633. int _toolaction(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  634. {
  635.     put_objects(data, pszIn, nOffset, (PSTR) gadget, ToolActionObjectList, ELEMENTS(ToolActionObjectList));
  636.  
  637.     return(sizeof(toolaction_object));
  638. }
  639.  
  640. void toolaction(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  641. {
  642.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, ToolActionObjectList, ELEMENTS(ToolActionObjectList), 2);
  643. }
  644.  
  645.  
  646. //
  647.  
  648. static FLAGS WritableFieldFlags[] = {
  649.     {writablefield_GENERATE_USER_VALUE_CHANGED, "writablefield_GENERATE_USER_VALUE_CHANGED"},
  650.     {writablefield_GENERATE_SET_VALUE_CHANGED , "writablefield_GENERATE_SET_VALUE_CHANGED" },
  651.     {writablefield_RJUSTIFIED                 , "writablefield_RJUSTIFIED"                 },
  652.     {writablefield_HCENTRED                   , "writablefield_HCENTRED"                   },
  653.     {writablefield_CONCEAL_TEXT               , "writablefield_CONCEAL_TEXT"               },
  654.     {gadget_FADED                             , "gadget_FADED"                             },
  655.     {gadget_AT_BACK                           , "gadget_AT_BACK"                           }
  656. };
  657.  
  658. static OBJECTLIST WritableFieldObjectList[] = {
  659.     {iol_FLAGS, "flags:",     offsetof(writablefield_object, flags),     WritableFieldFlags, ELEMENTS(WritableFieldFlags)                   },
  660.     {iol_MSG,   "text:",      offsetof(writablefield_object, text),      "text_limit:",      offsetof(writablefield_object, text_limit)     },
  661.     {iol_MSG,   "allowable:", offsetof(writablefield_object, allowable), "allowable_limit:", offsetof(writablefield_object, allowable_limit)},
  662.     {iol_CMP,   "prev:",      offsetof(writablefield_object, prev),      NULL,               0                                              },
  663.     {iol_CMP,   "next:",      offsetof(writablefield_object, next),      NULL,               0                                              }
  664. };
  665.  
  666. int _writablefield(PDATA data, PSTR pszIn, int nOffset, gadget_object_base * gadget)
  667. {
  668.     put_objects(data, pszIn, nOffset, (PSTR) gadget, WritableFieldObjectList, ELEMENTS(WritableFieldObjectList));
  669.  
  670.     return(sizeof(writablefield_object));
  671. }
  672.  
  673. void writablefield(FILE * hf, gadget_object_base * gadget, PSTR pszStringTable, PSTR pszMessageTable)
  674. {
  675.     get_objects(hf, pszStringTable, pszMessageTable, (PSTR) gadget, WritableFieldObjectList, ELEMENTS(WritableFieldObjectList), 2);
  676. }
  677.